#include "graph.h"
/* Good luck */
void depth_first(Graph * theGraph, int visited[], int start, int count, int nodeNum, Value*high)
{
  //printf("%d\n", count);
  visited[start] = 1;
  List *current;
  current = (List*)malloc(sizeof(List));
  current = theGraph->table[start].outlist;
  //printf("%d\n", current -> index); 
  while(current != NULL)
  {
    //printf("asdasd  = >> %d\n", current -> index);
    if((visited[current -> index]) == 0)
    {
      //printf("i am here.");
      if(nodeNum <  theGraph -> table[start].outdegree)
      {
        high -> bestNode = start;
        //printf("%d\n", value[0]);
	nodeNum = theGraph -> table[start].outdegree;
        //high = start;
        high -> bestCount = count;
        //printf("%d\n", value[1]);
	count ++;
      }
      depth_first(theGraph, visited, current -> index, count, nodeNum, high);
    }
    else
    {
      //printf("I am in next");
      current = current -> next;
      //printf("next Value %d\n", current->index);
    }
  }     
}

/*
void breadth_first(Graph * theGraph, int visited[], int start)
{ 
  //visited[start] = 1;
  int i;
  int j = 0;
  List *current;
  current = (List*)malloc(sizeof(List));
  current = theGraph->table[start].outlist;  
  printf ("MAX %d\n", mygraph->MaxSize);
  while(current != NULL)
  {
    current = current -> next;
    
    if(current -> next == NULL)
    {
      current = theGraph->table[current -> index].outlist;
    }
    else
    {
      List *current;
      currentTwo = (List*)malloc(sizeof(List));
      currentTwo = theGraph->table[(current -> next) -> index].outlist;
      while(currentTwo != NULL)
      {
	currentTwo = currentTwo -> next;
      }//for
      current = current -> next;
    }//else
    
  }//while
}//breadth_first
*/
